package com.uls.ldcm.service.impl;

import java.util.List;

import com.uls.common.utils.DateUtils;
import com.uls.common.utils.SecurityUtils;
import com.uls.ldcm.domain.vo.SalaryCountVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.uls.ldcm.mapper.SalaryrecordsMapper;
import com.uls.ldcm.domain.Salaryrecords;
import com.uls.ldcm.service.ISalaryrecordsService;

/**
 * 薪资记录Service业务层处理
 * 
 * @author gw
 * @date 2024-11-11
 */
@Service
public class SalaryrecordsServiceImpl implements ISalaryrecordsService 
{
    @Autowired
    private SalaryrecordsMapper salaryrecordsMapper;

    /**
     * 查询薪资记录
     * 
     * @param recordId 薪资记录主键
     * @return 薪资记录
     */
    @Override
    public Salaryrecords selectSalaryrecordsByRecordId(Long recordId)
    {
        return salaryrecordsMapper.selectSalaryrecordsByRecordId(recordId);
    }

    /**
     * 查询薪资记录列表
     * 
     * @param salaryrecords 薪资记录
     * @return 薪资记录
     */
    @Override
    public List<Salaryrecords> selectSalaryrecordsList(Salaryrecords salaryrecords)
    {
        return salaryrecordsMapper.selectSalaryrecordsList(salaryrecords);
    }

    /**
     * 新增薪资记录
     * 
     * @param salaryrecords 薪资记录
     * @return 结果
     */
    @Override
    public int insertSalaryrecords(Salaryrecords salaryrecords)
    {
        salaryrecords.setCreatedAt(DateUtils.getNowDate());
        salaryrecords.setCreateBy(SecurityUtils.getLoginUser().getUser().getUserName());
        return salaryrecordsMapper.insertSalaryrecords(salaryrecords);
    }

    /**
     * 修改薪资记录
     * 
     * @param salaryrecords 薪资记录
     * @return 结果
     */
    @Override
    public int updateSalaryrecords(Salaryrecords salaryrecords)
    {
        salaryrecords.setUpdatedAt(DateUtils.getNowDate());
        salaryrecords.setUpdateBy(SecurityUtils.getLoginUser().getUser().getUserName());
        return salaryrecordsMapper.updateSalaryrecords(salaryrecords);
    }

    /**
     * 批量删除薪资记录
     * 
     * @param recordIds 需要删除的薪资记录主键
     * @return 结果
     */
    @Override
    public int deleteSalaryrecordsByRecordIds(Long[] recordIds)
    {
        return salaryrecordsMapper.deleteSalaryrecordsByRecordIds(recordIds);
    }

    /**
     * 删除薪资记录信息
     * 
     * @param recordId 薪资记录主键
     * @return 结果
     */
    @Override
    public int deleteSalaryrecordsByRecordId(Long recordId)
    {
        return salaryrecordsMapper.deleteSalaryrecordsByRecordId(recordId);
    }

    /**
     * 查询薪资记录列表
     *
     *
     * @return 薪资记录
     */
    @Override
    public List<SalaryCountVo> selectSalaryCountVoList() {
    	return salaryrecordsMapper.selectSalaryCountVoList();
    }
}
